#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int main() {
  string x, y;
  cin >> x >> y;
  mp["Ocelot"] = 1;
  mp["Serval"] = 2;
  mp["Lynx"] = 3;

  if (mp[x] >= mp[y]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  

  return 0;
}